﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
namespace Web.Views.AgentManager
{
    public partial class IncomingOrders : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Easydp.Controllers.AgentController.AgentInfo != null)
                    HiddenField1.Value = Easydp.Controllers.AgentController.AgentInfo.AgentID.ToString();
                else
                    Response.Redirect("../Shared/login.aspx");
            }
        }

      
       
        protected void Button3_Click(object sender, EventArgs e)
        {
            GridView1.DataBind();
           
        }

   


        protected void btnUpload_Click(object sender, EventArgs e)
        {
            string str = ((Button)sender).CommandArgument;
            int OrderID = int.Parse(((Button)sender).CommandName.ToString());
            int State = 0;
            if ("chu" == str)
            {
                State = 3;
            }
            else
            {
                State = 4;
            }
            Easydp.Controllers.OrderController bll = new Easydp.Controllers.OrderController();
            string length=bll.UpdateOrders(OrderID,State);
            if (length.Length < 2)
            {
                Response.Write("<script>alert('操作成功!');window.location.href='" + Request.RawUrl.ToString() + "'</script>");
            }
            else
            { Response.Write("<script>alert('操作失败!');window.location.href='" + Request.RawUrl.ToString() + "'</script>"); }
        }

     
       
    }
}
